<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.staticfile.org/axios/0.18.0/axios.min.js"></script>
    <script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
</head>
<body>
<div id="div10">
    <form>
        <input type="text" v-model="name" name="name" placeholder="请输入用户名"><br>
        <input type="password" v-model="password" name="password" placeholder="请输入密码"><br>
        <button @click="login">登录</button>
    </form>
</div>
</body>
<script>
    var vue10=new Vue({
        el:"#div10",
        data:{
            name:"",
            password:""
        },
        methods:{
            login:function () {
              axios.post("http://localhost:2020/login",{
                  name: this.name,
                  password:this.password
              }).then(response=>console.log(response.data))
                .catch(function (error) {
                  console.log(error)
                })
            }
        }
    })
</script>
</html>